// IE5EventTwo.cpp : implementation file
//

#include "stdafx.h"
#include "vfwcap.h"
#include "IE5EventTwo.h"
#include "vfwcapDlg.h"

#include <ExDisp.h>  // Contains declaration for IWebBrowser2
#include <EXDISPID.H> 

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// IE5EventTwo

IMPLEMENT_DYNCREATE(CIE5EventsTwo, CCmdTarget)

CIE5EventsTwo::CIE5EventsTwo(CVfwcapDlg * pParent /* = NULL */) : m_pParent(pParent)
{
   ASSERT(m_pParent);

   EnableAutomation();  // Needed in order to sink events.
}

CIE5EventsTwo::~CIE5EventsTwo()
{
}


BEGIN_MESSAGE_MAP(CIE5EventsTwo, CCmdTarget)
	//{{AFX_MSG_MAP(CIE5Events)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
	END_MESSAGE_MAP()
	
	BEGIN_DISPATCH_MAP(CIE5EventsTwo, CCmdTarget)
	
	DISP_FUNCTION_ID(CIE5EventsTwo, "OnQuit", DISPID_ONQUIT, OnQuit, VT_EMPTY, VTS_NONE)
	
	END_DISPATCH_MAP()
	
	//
	// Add DIID_DWebBrowserEvents2 to the interface map to tell
	// Internet Explorer that you support this event sink.  
	// Internet Explorer will query for this interface when 
	// you call AfxConnectionAdvise.  If Internet Explorer
	// does not find this interface, it will then query for IDispatch.
	//
	BEGIN_INTERFACE_MAP(CIE5EventsTwo, CCmdTarget)
	INTERFACE_PART(CIE5EventsTwo, DIID_DWebBrowserEvents2, Dispatch)
	END_INTERFACE_MAP()
	
	/////////////////////////////////////////////////////////////////////////////
	// CIE5Events event handlers
	
	
	void CIE5EventsTwo::OnQuit()
{
	//	m_pParent->AddEventToList(CMFCIEEvtSpyDlg::IE5ListBox, "Quit");
	m_pParent->OnIE5TwoQuit();
	
	
}
